import React,{Component} from 'react';
import ReactDOM from 'react-dom';

import {Router,Route,hashHistory,IndexRoute} from 'react-router';
import {Provider} from 'react-redux';
import store from './store/index';
import reducer from './reducers/index';
import {connect} from 'react-redux';
import DevTools from './store/DevTools';

import App from './modules/App.js';
import Login from './modules/Login.js';
import Register from './modules/Register.js';
import Unlogin from './modules/Unlogin.js';
import Home from './modules/Home.js';
import About from './modules/About.js';
import Carts from './modules/Carts.js';
import Product from './modules/Product.js';
import Pdtdetail from './modules/Pdtdetail.js';
import News from './modules/News.js';
import Comment from './modules/Comment.js';
import 'element-theme-default';
// const store = finalCreateStore(reducer);

class Routes extends Component{
    
    render(){
        return (
            <Provider store={store}>
                <div>
                    <Router history={hashHistory}>
                        <Route path="/" component={App}>
                            <IndexRoute component={Home}/>
                            <Route path="/login" component={Login}/>
                            <Route path="/register" component={Register}/>
                            <Route path="/unlogin" component={Unlogin}/>
                            <Route path="/home" component={Home}/>
                            <Route path="/about" component={About}/>
                            <Route path="/carts" component={Carts}/>
                            <Route path="/product" component={Product}/>
                            <Route path="/detail" component={Pdtdetail}/>
                            <Route path="/news" component={News}/>
                            <Route path="/comment/:data" component={Comment}/>
                        </Route>
                    </Router>
                </div>
            </Provider>
        )
    }
}

ReactDOM.render(
    <Routes/>
    ,document.getElementById('app')
);